import {
  HOST,
} from '../../../config/config.app';
import FetchUtil from '../../utils/FetchUtil';

class User {
  static info = async (params, token) => {
    const result = await FetchUtil.fetchNoToken(`${HOST}/api/v1/user/one`);

    return result;
  }

  static register = async (params, token) => {
    const result = await FetchUtil.fetchByToKen(`${HOST}/api/v1/user/one`, {
      method: 'POST',
      headers: {
        Authorization: `Bearer ${token}`
      },
    });

    return result;
  }

  static passwordModify = async (params, token) => {
    const result = await FetchUtil.fetchByToKen(`${HOST}/user/password/modify`, {
      method: 'PUT',
      data: params,
      headers: {
        Authorization: `Bearer ${token}`
      },
    });

    return result;
  }
}

export default User;
